<!-- expects local value "prompt" -->
<div class="wrapper">
  <dl class="collection meta">
    <% any_types = TagSet::TAG_TYPES.select {|type| prompt.send("any_#{type}")} %>
    <% if any_types || (prompt.tag_set && !prompt.tag_set.tags.empty?) %>
      <dt>Tags:</dt>
      <dd>
        <ul class="tags">
          <%= prompt.tag_set && !prompt.tag_set.tags.empty? ? tag_link_list(prompt.tag_set.tags) + (any_types.empty? ? "" : ", ") : "" %>
          <% unless any_types.empty? %>
            <%= any_types.map {|type| content_tag(:li, h(ts("Any %{type}", :type => type.capitalize))) }.join(", ").html_safe %>
          <% end %>
        </ul>
        <% if prompt.optional_tag_set && !prompt.optional_tag_set.tags.empty? %>
          <p>Optional:</p>
          <ul class="tags">
            <%= tag_link_list(prompt.optional_tag_set.tags) %>
          </ul>
        <% end %>
      </dd>
    <% end %>
    <% unless prompt.url.blank? %>
      <dt><%= ts("URL") %>:</dt>
      <dd><%= link_to(prompt.url, prompt.url) %></dd>
    <% end %>
    <% unless prompt.description.blank? %> 
      <dt><%= ts("Details") %>:</dt>
      <dd><%= raw sanitize_field(prompt, :description) %></dd>
    <% end %>
  </dl>
</div>
